﻿/*------------------------------------------------------------
 * Author : Tharinduni Udugamasuriya
 * FinCon dll for Handeling DB 
 * ParameterWithValue : Stored Procedure Parameter Values
 -----------------------------------------------------------*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;
using DSPL.Contracts;

namespace DSPL.DataAccess
{
    public class ParameterWithValue 
    {
        public SqlParameter SpParameter;

        public ParameterWithValue(string paraName, object value)
        {
            SpParameter = new SqlParameter(paraName, value);
        }

        public ParameterWithValue(string paraName, object value, SqlDbType type)
        {
            SpParameter = new SqlParameter(paraName, value);
            SpParameter.SqlDbType = type;
        }

        public ParameterWithValue(string paraName, object value, SqlDbType type, ParameterDirection direction)
        {
            SpParameter = new SqlParameter(paraName, value);
            SpParameter.SqlDbType = type;
            SpParameter.Direction = direction;
        }

        public ParameterWithValue(string paraName, object value, SqlDbType type, ParameterDirection direction, int size)
        {
            SpParameter = new SqlParameter(paraName, value);
            SpParameter.SqlDbType = type;
            SpParameter.Direction = direction;
            SpParameter.Size = size;
        }

        public object GetValue()
        {
            return SpParameter.Value;
        }
    }
}
